package kr.hkit.powerjava.chapter07.work;

class BankAccount {
	private int balance;

	void deposit(int amount) {
		balance = balance + amount;
	}

	void withdraw(int amount) {
		if (balance > 0) {
			balance = balance - amount;
		}
	}

	public int getBalance() {
		return balance;
	}

	public void setBalance(int balance) {
		this.balance = balance;
	}

	void addInterest() {
		balance = (int) (balance * 1.075);
	}

}

public class BankAccountTest {

	public static void main(String[] args) {

		BankAccount b = new BankAccount();

		b.setBalance(100);
		b.withdraw(60);
		System.out.println("현재 잔고는 " + b.getBalance() + "원 입니다.");

		b.addInterest();
		System.out.println("현재 잔고는 " + b.getBalance() + "원 입니다.");
	}
}
